1 Public Class FrmSUPPLIERSPRODUCT
2
3 Private Sub FrmSUPPLIERSPRODUCT_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
4 'MDIREFRESH()
5 MDIDISABLED()
6 End Sub
7 Private Sub FrmSUPPLIERSPRODUCT_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
8 FillListView(ExecuteSQLQuery("select Supp_ID as 'Supplier ID', suppName as 'Supplier Name', suppadd as 'Address', suppcontact as 'Contact No', ContactPerson as 'Contact Person' FROM tbl_suppliers ORDER BY suppName ASC"), lstSuppliers, 1)
9 MDIREFRESH()
10 With MDIMain
11 '.cmdNew.Enabled = False
12 '.cmdEdit.Enabled = False
13 '.cmdDelete.Enabled = False
14 ' .ToolStripNew.Enabled = False
15 ' .ToolStripEdit.Enabled = False
16 ' .ToolStripDelete.Enabled = False
17 End With
18 Audit_Trail(xUser_ID, TimeOfDay, "View Suppliers Product Listing")
19 End Sub
20
21 Private Sub lstSuppliers_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lstSuppliers.Click
22 sqlSTR = "SELECT Item_ID as 'ID', Replace(Replace(Item_Name,'$.$',''''),'$..$',',') as 'Name', Item_Description as 'Description / Item Number' FROM TBL_Category_Item_File, TBL_Category_File WHERE TBL_Category_Item_File.Item_ID IN " & _
23 "(SELECT TBL_Suppliers_Product.Item_ID FROM TBL_Suppliers_Product WHERE Supp_ID = " & lstSuppliers.FocusedItem.Text & ") AND TBL_Category_File.Catg_ID = TBL_Category_Item_File.Catg_ID " & _
24 " ORDER BY Item_Name ASC"
25 FillListView(ExecuteSQLQuery(sqlSTR), lstSupplies, 0)
26 End Sub
27
28 Private Sub CmdSearch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CmdSearch.Click
29 sqlSTR = "SELECT Supp_ID as 'Supplier ID', suppName as 'Supplier Name', suppadd as 'Address', suppcontact as 'Contact No', ContactPerson as 'Contact Person' " & _
30 "FROM tbl_suppliers " & _
31 "WHERE SuppName LIKE '%" & txtname.Text & "%'"
32 FillListView(ExecuteSQLQuery(sqlSTR), lstSuppliers, 0)
33 grpCat.Visible = False
34 End Sub
35
36 Private Sub cmdcancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdcancel.Click
37 grpCat.Visible = False
38 End Sub
39
40 Private Sub lstSuppliers_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lstSuppliers.SelectedIndexChanged
41
42 End Sub
43
44 Private Sub FrmSUPPLIERSPRODUCT_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Resize
45 With Me
46 GroupBox1.Width = (.Width - (MDIMain.TSHoldRight.Width / 2)) + 60
47 GroupBox1.Height = .Height - (MDIMain.TSHoldAdvisory.Height + 57)
48 .lstSuppliers.Width = GroupBox1.Width - 14
49 .lstSupplies.Width = GroupBox1.Width - 36
50 .lstSupplies.Height = (GroupBox1.Height - lstSuppliers.Height) - 60
51 '.lstCategory.Width = GroupBox1.Width - 28
52 '.lstCategory.Height = (GroupBox1.Height / 2) - 53
53 End With
54
55 End Sub
56
57 Private Sub lstSupplies_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lstSupplies.SelectedIndexChanged
58
59 End Sub
60 End Class